package com.ruoyi.commodity.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * 质检模板详细表
 * @TableName tb_quality_template_item
 */
@TableName(value ="tb_quality_template_item")
@Data
public class QualityTemplateItem implements Serializable {
    /**
     * 质检项ID
     */
    @TableId(value = "item_id", type = IdType.AUTO)
    private Long itemId;

    /**
     * 关联的模板ID
     */
    @TableField(value = "template_id")
    private Long templateId;

    /**
     * 质检项名称
     */
    @JsonProperty("checkItem")
    @TableField(value = "inspection_item")
    private String inspectionItem;

    /**
     * 质检内容
     */
    @JsonProperty("checkContent")
    @TableField(value = "inspection_content")
    private String inspectionContent;

    /**
     * 创建时间
     */
    @TableField(value = "created_time")
    private Date createdTime;

    /**
     * 更新时间
     */
    @TableField(value = "updated_time")
    private Date updatedTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        QualityTemplateItem other = (QualityTemplateItem) that;
        return (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
            && (this.getTemplateId() == null ? other.getTemplateId() == null : this.getTemplateId().equals(other.getTemplateId()))
            && (this.getInspectionItem() == null ? other.getInspectionItem() == null : this.getInspectionItem().equals(other.getInspectionItem()))
            && (this.getInspectionContent() == null ? other.getInspectionContent() == null : this.getInspectionContent().equals(other.getInspectionContent()))
            && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
            && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
        result = prime * result + ((getTemplateId() == null) ? 0 : getTemplateId().hashCode());
        result = prime * result + ((getInspectionItem() == null) ? 0 : getInspectionItem().hashCode());
        result = prime * result + ((getInspectionContent() == null) ? 0 : getInspectionContent().hashCode());
        result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
        result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", itemId=").append(itemId);
        sb.append(", templateId=").append(templateId);
        sb.append(", inspectionItem=").append(inspectionItem);
        sb.append(", inspectionContent=").append(inspectionContent);
        sb.append(", createdTime=").append(createdTime);
        sb.append(", updatedTime=").append(updatedTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}